package net.wenku8.reader.view.user

import androidx.compose.foundation.layout.Column
import androidx.compose.runtime.Composable
import androidx.lifecycle.viewmodel.compose.viewModel
import net.wenku8.reader.ui.lite.LiteButton
import net.wenku8.reader.ui.lite.LitePanel

@Composable
fun CacheClear() {
    val cacheClearViewModel = viewModel<CacheClearViewModel>()
    LitePanel(
        hostState = cacheClearViewModel.hostState,
        title = "清除缓存",
        backNav = true
    ) {
        Column{
            LiteButton(text = "清除全部数据") {
                cacheClearViewModel.clearAll()
            }
            LiteButton(text = "清除阅读习惯设置") {
                cacheClearViewModel.clearCustom()
            }
            LiteButton(text = "清除本地文件书架") {
                cacheClearViewModel.clearBookFile()
            }
            LiteButton(text = "清除文库书籍缓存") {
                cacheClearViewModel.clearWenku8Book()
            }
            LiteButton(text = "清除文库账户缓存") {
                cacheClearViewModel.clearWenku8Account()
            }
        }
    }

}

